<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />

	<!-- blueprint CSS framework -->
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
	<!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->

	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />

	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>

<body>

<div class="container" id="page">

	<div id="header">
		<div id="logo"><?php echo CHtml::encode(Yii::app()->name); ?></div>
	</div><!-- header -->

	<div id="mainmenu">
		<?php 
		$languages = Yii::app()->params['languages'];
		$params = $_REQUEST;
		foreach($languages as $langid => $tag){
			$langs[] = array('label'=>Yii::t('mainnav',$tag), 
											 'url'=>array('/'.Yii::app()->controller->getId().'/'.Yii::app()->controller->getAction()->getId(), 'lang'=>$langid,'test'=>2),
											'active'=>Yii::app()->language==$langid,
											);
		};
		$this->widget('zii.widgets.CMenu',array(
			'items'=>array_merge(array(
				array('label'=>Yii::t('mainnav','Home'), 'url'=>array('/site/index')),
				array('label'=>Yii::t('mainnav','Wiki'), 'url'=>array('/wiki'), 'active'=>$this->id=='wiki'),
				array('label'=>Yii::t('mainnav','Basic'), 'url'=>array('/site/basic'),
							'items'=>array(array('label'=>'submenu1','url'=>array('/site/contact')),
														 array('label'=>'submenu2','url'=>array('/site/contact')),
														 array('label'=>'submenu3','url'=>array('/site/contact')),
											),
							),
				array('label'=>Yii::t('mainnav','About'), 'url'=>array('/site/page', 'view'=>'about')),
				array('label'=>Yii::t('mainnav','Contact'), 'url'=>array('/site/contact')),
				array('label'=>Yii::t('mainnav','Login'), 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
				array('label'=>Yii::t('mainnav','Gii'), 'url'=>array('/gii'), 'visible'=>defined('YII_DEBUG')),
				array('label'=>Yii::t('mainnav','Logout').' ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest),
			),$langs),
		));
		?>
	</div><!-- mainmenu -->
	<?php if(isset($this->breadcrumbs)):?>
		<?php $this->widget('zii.widgets.CBreadcrumbs', array(
			'links'=>$this->breadcrumbs,
		)); ?><!-- breadcrumbs -->
	<?php endif?>
	<div class="span-5 right last" style="overflow:hidden">
		<!--flash messages-->
		<?php new dBug(Yii::app()->user->getFlashes());?>
		<?php //new dBug($_REQUEST);?>
	</div>

	<?php echo $content; ?>

	<div class="clear"></div>

	<div id="footer">
		Copyright &copy; <?php echo date('Y'); ?> by Ding Hao.<br/>
		All Rights Reserved.<br/>
		<?php echo Yii::powered(); ?>
	</div><!-- footer -->

</div><!-- page -->

</body>
</html>
